Skip to content

php_reflection.c: remove unneeded do-while in DUMP_CONST_FLAG macro#15832

Closed
DanielEScherzer wants to merge 1 commit into
php:masterfrom
DanielEScherzer:patch-2
Closed

php_reflection.c: remove unneeded do-while in DUMP_CONST_FLAG macro#15832
DanielEScherzer wants to merge 1 commit into
php:masterfrom
DanielEScherzer:patch-2

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Member

The do-while trick is used to allow including multiple statements where only one is expected, but in this case we know that the uses on the next few lines permit including multiple statements, so the extra do-while wrapper is unneeded.

The do-while trick is used to allow including multiple statements where only
one is expected, but in this case we know that the uses on the next few lines
permit including multiple statements, so the extra do-while wrapper is
unneeded.
@iluuu1994

Copy link
Copy Markdown
Member

do {} while (0) are considered best-practice for macros. You'll find them in many cases where they aren't strictly necessary. Removing them doesn't add much value.

@iluuu1994

Copy link
Copy Markdown
Member

As explained here: #15925 (comment) 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants